<?php
declare (strict_types=1);

namespace app\model;

use think\Model;

/**
 * @mixin \think\Model
 */
class BlogCat extends Model
{
    protected $table = 'ctmon_blog_cat';
    protected $pk = 'cat_id';

    protected $schema = [
        'cat_id' => 'int',
        'parent_id' => 'int',
        'nav_id' => 'int',
        'cat_name' => 'varchar',
        'cat_type' => 'int',
        'content_type' => 'int',
        'show_in_nav' => 'bit',
        'is_review' => 'bit',
        'cat_path' => 'text',
        'cat_level' => 'int',
        'sort_order' => 'int',
        'page_size' => 'int',
        'list_tlp' => 'varchar',
        'info_tlp' => 'varchar',
        'urlrewriter' => 'varchar',
        'pagetitle' => 'text',
        'pagekeywords' => 'text',
        'pagedesc' => 'text',
        'pic' => 'text',
        'ms' => 'text',
        'is_mobile' => 'bit',
        'en_cat_name' => 'varchar',
        'pich' => 'text',
        'url' => 'varchar',
    ];

    public function getSchema(): array
    {
        return $this->schema;
    }


    /**
     * 新闻列表
     * @return \think\model\relation\HasMany
     */
    public function blogs()
    {
        return $this->hasMany(Blog::class, 'cat_id', 'cat_id');
    }
}
